// import {MAILING_ADDRESS} from 'actionsTypes'
import getDataService from '../services/getData';
import {Toast} from 'antd-mobile';

export const addressListData=(data, callBack)=>{
	return (dispatch, getState)=>{
		Toast.hide(); //加载前 先关闭其他加载中的提示框 避免提示框一直存在的bug
		Toast.loading("", 30, () => Toast.info("网络错误", 2));
		getDataService.addressList(data).then(resultData=>{
			
			if (resultData.code == 1000) {
				if(callBack){
					callBack(resultData.data.addressList)
				}
			}else{
				Toast.info(resultData.msg, 2);
			}

		})
	}
}